import NodeUtil from "./libs/NodeUtil";
import { Global } from "../util";


const nodeUtil = new NodeUtil();

export class BaseParser {
    get themeColor() {
        return Global.appConfig.theme['theme-color'];
    }

    setThemeColor(node: any, attr: string) {
        nodeUtil.normalizeNodeAttr(node, attr);
        if (!node.attribs[attr]) {
            node.attribs[attr] = this.themeColor;
        }
    }

    transformTag(options: any) {
        nodeUtil.transformTag(options);
    }

    setTruthyClasses(node: any, attrs: any) {
        nodeUtil.setTruthyClasses(node, attrs);
    }
}
